use axum::Router;

pub trait IRouter {
    fn init_router(&self, router: Router) -> Router;
}

pub fn run_router(mut router: Router, routers: Vec<Box<dyn IRouter>>) -> Router {
    for x in routers.iter() {
        router = x.init_router(router);
    }
    router
}

pub fn run_router_self(routers: Vec<Box<dyn IRouter>>) -> Router {
    let mut router = Router::new();
    for x in routers.iter() {
        router = x.init_router(router);
    }
    router
}
